#pragma once 
#include "brtree.hpp"

/**
 * 
 * @name set
 * @author nhy 
 * @version v1.0.0
*/

namespace nhydata
{
template<class Key>
class set
{
    struct SetKeyOfT{
        const Key& operator()(const Key& key){
            return key;
        }
    };
public:
    bool insert(const Key& key)
    {
        return rb_tree.insert(key).second;
    }
private:
    RBTree<Key,Key,SetKeyOfT> rb_tree;
};//class set end


void test_set()
{
    nhydata::set<int> s;
    s.insert(1);
    s.insert(4);
    s.insert(5);
    s.insert(9);
}


}

